﻿using DIM_Tool;
using Sunny.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DIM_Agreement;
namespace DIM_Server.Agreement_from
{
    public partial class UserControl_HTTP : UIUserControl
    {
        HTTP http = new HTTP();
        public UserControl_HTTP()
        {
            InitializeComponent();
        }
        //加载时，初始化
        private void UserControl_HTTP_Load(object sender, EventArgs e)
        {
            Public_Class.Http_mess = uiRichTextBox1;
            timer1.Interval = 60000;
        }
        private void UiSwitch1_ValueChanged(object sender, bool value)
        {
            if (value)
            {
                timer1.Start();
                http.Main_checker(uiTextBox1.Text);
                UIMessageTip.ShowOk("开启HTTP协议");
            }
            else
            {
                timer1.Stop();
                http.Dispose();
                UIMessageTip.ShowError("关闭HTTP协议");
            }
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            Public_Class.Http_mess.Text = "";
        }

    }
}
